package com.quanyou.exception;

import com.quanyou.utils.ErrorCode;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;

/**
 * Created by xuyi on 2015/11/18.
 */
public class OecIntfcException extends RuntimeException {

	private int errorCode;
	private String message;

	public OecIntfcException(int errorCode) {
		this.errorCode = errorCode;
	}

	public OecIntfcException(int errorCode, String message) {
		this.errorCode = errorCode;
		this.message = message;
	}

	public OecIntfcException(int errorCode, ReloadableResourceBundleMessageSource messageSource) {
		this.errorCode = errorCode;
		this.message = ErrorCode.getErrorMessage(errorCode, messageSource);
	}

	public OecIntfcException() {
		super();
	}

	public int getErrorCode() {
		return errorCode;
	}

	@Override
	public String getMessage() {
		return message;
	}

}
